<template>
  <div id="main-app">
    <el-container>
      <el-header class="main-hd" v-show="!isLoginPage">
        <Header />
      </el-header>
      <el-main class="main-mn">
        <el-scrollbar class="main-mn-wrap">
          <!-- mainApp路由视图 -->
          <transition name="fade">
            <router-view />
          </transition>
          <div id="subapp-container">
            <div v-html="appContent"></div>
          </div>
        </el-scrollbar>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import Header from "@/components/header/index";
import { mapGetters } from "vuex";
export default {
  name: "main-view",
  props: {
    appContent: String,
    loading: Boolean
  },
  components: {
    Header
  },
  computed: {
    ...mapGetters(["isLoginPage"])
  }
};
</script>

<style lang="scss">
@import "@/common/scss/variables.scss";

header.main-hd {
  height: $hdNavHeight !important;
  padding: 0;
}
main.main-mn {
  width: 100vw;
  max-height: calc(100vh - #{$hdNavHeight});
  padding: 0 2px;
  box-sizing: border-box;
  .main-mn-wrap {
    height: calc(100vh - #{$hdNavHeight}) !important;
    .el-scrollbar__wrap {
      overflow-x: hidden;
    }
    .el-scrollbar__thumb {
      background-color: rgba(144, 147, 153, 0.6);
      &:hover {
        background-color: rgba(144, 147, 153, 0.8);
      }
    }
  }
}
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.25s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>


